-- #lazgen HEADER#
/*
	spGoalListByStatus.

	This procedure returns a list of all Goal from the database.
*/
SET ANSI_NULLS ON
GO

ALTER PROCEDURE [spGoalListByStatus]
(		
	@statusId INT

) AS
		
BEGIN
-- #endlazgen HEADER#

-- #lazgen BODY#

SELECT
	[goal].[Id],
	[goal].[Title],
	[goal].[StatusId],
	[goal].[Created],
	[goal].[Modified],
	[status].[Title]
FROM
	[tblGoal] [goal]
	INNER JOIN [tblGoalStatus] [status] ON [goal].[StatusId] = [status].[Id]
WHERE
	[goal].[StatusId] = @statusId

-- #endlazgen BODY#


-- #lazgen FOOTER#

END

GO

SET ANSI_NULLS OFF
GO   
-- #endlazgen FOOTER#
